
import VueRouter from "vue-router";

// 导入组件
import HomeContainer from "./components/tabbar/HomeContainer.vue";
import MemberComtainer from "./components/tabbar/MemberContainer.vue";
import ShopcarComtainer from "./components/tabbar/ShopcarContainer.vue";
import SearchContainer from "./components/tabbar/SearchContainer.vue";

// 新闻
import NewsList  from "./components/news/newslist.vue";
import NewsInfo from "./components/news/newsinfo.vue";
// 图片
import photolist from "./components/photos/photolist.vue";
import photoinfo from "./components/photos/photoinfo.vue";

// 商品购买
import goodslist from "./components/goods/GoodsList.vue";
import goodsinfo from "./components/goods/GoodsInfo.vue";
import goodsdesc from "./components/goods/goodsdesc.vue";


var router = new VueRouter({
    routes:[//这里是routes而不是routers
        
        {path: '/', redirect: '/home'},
        {path: '/home', component: HomeContainer},
        {path: '/member', component: MemberComtainer},
        {path: '/shopcar', component: ShopcarComtainer},
        {path: '/search', component: SearchContainer},
        {path:"/home/newslist",component:NewsList},
        {path:"/home/newsinfo/:id",component:NewsInfo},
        {path:"/home/photolist",component:photolist},
        {path:"/home/photoinfo/:id",component:photoinfo},
        {path:"/home/goodslist",component:goodslist},
        {path:"/home/goodsinfo/:id",component:goodsinfo},
        {path:"/home/goodsdesc/:id",component:goodsdesc},
    ],
    linkActiveClass:"mui-active"//覆盖默认高亮路由的类router-link-active
})

export default router